package com.example.forum_system.searchEngine.exception;

import com.example.forum_system.common.Result;

/**
 * @BelongsProject: 0.forum_system
 * @BelongsPackage: com.example.forum_system.SE
 * @Author : 游在海里的鱼
 * @CreateTime : 2023-12-01  20:59
 * @Version : 1.0
 * @Description : 搜索引擎的异常类
 */
public class SearchEngineException extends Exception{
    //错误结果
    protected Result errorResult;

    /*------------------------------------普--通--方--法------------------------------------------------------------------
     * @Desc  : 获取异常的错误结果
     * @Param : []
     * @Return: com.example.forum_system.common.Result
    **/
    public Result getErrorResult() {
        return errorResult;
    }

    /*------------------------------------普--通--方--法------------------------------------------------------------------
     * @Desc  : 四种构造方法
     * @Param : [result]
     * @Return:
    **/
    public SearchEngineException(Result result){
        super(result.getMessage());
        errorResult = result;
    }
    public SearchEngineException(String message) {
        super(message);
    }

    public SearchEngineException(String message, Throwable cause) {
        super(message, cause);
    }

    public SearchEngineException(Throwable cause) {
        super(cause);
    }
}
